Telegram Group & Telegram Channel
اسکریپت Lua برای DHT11

pin = 1

status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin

if status == dht.OK then —check status is ok and print temperature and humidity

print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))

elseif status == dht.ERROR_CHECKSUM then —else print either status

print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end

🆔 @micropython_iot



tg-me.com/micropython_iot/28
Create:
Last Update:

اسکریپت Lua برای DHT11

pin = 1

status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin

if status == dht.OK then —check status is ok and print temperature and humidity

print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d",
math.floor(temp),
temp_dec,
math.floor(humi),
humi_dec
))

elseif status == dht.ERROR_CHECKSUM then —else print either status

print( "DHT Checksum error." )
elseif status ==
dht.ERROR_TIMEOUT then
print( "DHT timed out." )
end

🆔 @micropython_iot

BY Micropython & IOT


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/micropython_iot/28

View MORE
Open in Telegram


Micropython & IOT Telegram | DID YOU KNOW?

Date: |

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

Micropython & IOT from sa


Telegram Micropython & IOT
FROM USA